<template>
  <div>
    <task-controller
      :task-type="taskType"
      :format-task-list-column="format"
      :format-task-form-render="formatTaskFormRener"
    />
  </div>
</template>

<script>

import TaskController from '../components/index'
import { clearWorkNameMap } from '@/config/dict'

export default {
  components: { TaskController },

  data: function() {
    const format = (_formRender) => {
      const filterList = ['openDate', 'routeDesc']
      _formRender = _formRender.filter(e => !filterList.includes(e.key))
      return Promise.resolve(_formRender)
    }
    const formatTaskFormRener = (_formRender) => {
      return format(_formRender).then((__formRender) => {
        __formRender[0].type = 'select'
        __formRender[0].slotAttrs.options = clearWorkNameMap
        return Promise.resolve(__formRender)
      })
    }

    return { taskType: 5, format, formatTaskFormRener }
  }

}
</script>
